package com.guigu.www.denghao.controller;

import com.guigu.www.denghao.service.DHMenuService;
import com.guigu.www.pojo.Menu;
import com.guigu.www.pojo.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/DHMenuController")
public class DHMenuController {
    @Autowired
    private DHMenuService dhMenuService;

    @PostMapping("/initMenu")
    public PageVo<Menu> initMenu(Integer pageNum,Integer pageSize,String menuName){
        return dhMenuService.initMenu(pageNum,pageSize,menuName);
    }

    @PostMapping("/queryAllMenu")
    public List<Menu> queryAllMenu(){
        return dhMenuService.queryAllMenu();
    }

    @PostMapping("/delMenu")
    public Integer delMenu(Integer menuId,Integer menuState){
        return dhMenuService.delMenu(menuId,menuState);
    }


}
